<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>校事达-管理员注册</title>
    <link rel="stylesheet" href="./layui2_9/css/layui.css">
</head>

<body>
<div class="layui-layout layui-layout-admin">


    <!-- 内容主体区域-->
    <div class="layui-body ">

        <div style="padding: 30px;" class="layui-fluid">
            <div class="layui-row">
                <div class="layui-col-md12">
                    <span class="layui-badge-dot"></span> <span
                        class="layui-badge-dot layui-bg-orange"></span> <span
                        class="layui-badge-dot layui-bg-green"></span> <span
                        class="layui-badge-dot layui-bg-cyan"></span> <span
                        class="layui-badge-dot layui-bg-blue"></span> <span
                        class="layui-badge-dot layui-bg-black"></span> <span
                        class="layui-badge-dot layui-bg-gray"></span>
                    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
                        <legend>注册</legend>
                    </fieldset>
                </div>
            </div>

            <div class="layui-row">
                <div class="layui-col-md3">&nbsp;</div>
                <div class="layui-col-md6">
                    <fieldset class="layui-elem-field">
                        <legend>注册管理员信息</legend>
                        <div class="layui-field-box">
                            <div class="layui-tab">

                                <div class="layui-tab-content">

                                    <!--管理员-->
                                    <div class="layui-tab-item layui-show">

                                        <form class="layui-form" action="">
                                            <div class="layui-form-item">
                                                <label class="layui-form-label">管理员帐号</label>
                                                <div class="layui-input-block">
                                                    <input type="text" name="title" required  lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                                                </div>
                                            </div>
                                            <div class="layui-form-item">
                                                <label class="layui-form-label">管理员密码</label>
                                                <div class="layui-input-inline">
                                                    <input type="password" name="password" required lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                                                </div>
                                            </div>
                                            <div class="layui-form-item">
                                                <label class="layui-form-label">性别</label>
                                                <div class="layui-input-block">
                                                    <input type="radio" name="sex" value="男" title="男" checked>
                                                    <input type="radio" name="sex" value="女" title="女">
                                                </div>
                                            </div>
                                            <div class="layui-form-item">
                                                <label class="layui-form-label">生日</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="date" id="date" lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
                                                </div>
                                            </div>
                                            <div class="layui-form-item">
                                                <label class="layui-form-label">星座</label>
                                                <div class="layui-input-block">
                                                    <select name="city" lay-verify="required">
                                                        <option value=""></option>
                                                        <option value="1">水瓶座</option>
                                                        <option value="2">双鱼座</option>
                                                        <option value="3">白羊座</option>
                                                        <option value="4">金牛座</option>
                                                        <option value="5">双子座</option>
                                                        <option value="6">巨蟹座</option>
                                                        <option value="7">狮子座</option>
                                                        <option value="8">处女座</option>
                                                        <option value="9">天秤座</option>
                                                        <option value="10">天蝎座</option>
                                                        <option value="11">射手座</option>
                                                        <option value="12">摩羯座</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="layui-form-item">
                                                <label class="layui-form-label">学校</label>
                                                <div class="layui-input-block" style="width: 150px;">
                                                    <input name="school" placeholder="请输入选择" class="layui-input" id="ID-dropdown-school-base-input">
                                                </div>
                                            </div>
                                            <div class="layui-form-item">
                                                <label class="layui-form-label">专业</label>
                                                <div class="layui-input-block" style="width: 150px;">
                                                    <input name="professional" placeholder="请输入选择" class="layui-input" id="ID-dropdown-professional-base-input">
                                                </div>
                                            </div>
                                            <div class="layui-form-item layui-form-text">
                                                <label class="layui-form-label">自我介绍</label>
                                                <div class="layui-input-block">
                                                    <textarea name="desc" placeholder="请输入内容" class="layui-textarea"></textarea>
                                                </div>
                                            </div>
                                            <div class="layui-form-item">
                                                <div class="layui-input-block">
                                                    <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                                                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                                                </div>
                                            </div>
                                        </form>

                                        <script>
                                            //Demo
                                            layui.use('form', function(){
                                                var form = layui.form;

                                                //监听提交
                                                form.on('submit(formDemo)', function(data){
                                                    layer.msg(JSON.stringify(data.field));
                                                    return false;
                                                });
                                            });
                                        </script>

                                    </div>
                                </div>
                            </div>
                        </div>



                    </fieldset>
                </div>
            </div>
        </div>

        <div class="layui-footer" align="center">
            <!-- 底部固定区域 -->
            © - 联系校事达官方客服：6666666
        </div>
    </div>

</body>

<script src="./layui2_9/layui.js"></script>
<script>
    layui.use(['form', 'laydate'], function () {
        var form = layui.form,
            layer = layui.layer,
            laydate = layui.laydate;

        //日期
        laydate.render({
            elem: '#date'
        });
        laydate.render({
            elem: '#date1'
        });

        //自定义验证规则
        form.verify({
            studentid: function (value) {
                if (value.length < 3) {
                    return '学号至少是得3个字符的哦';
                }
            },
            account: function (value) {
                if (value.length < 3) {
                    return '账号至少是得3个字符的哦';
                }
            },
            password: [/(.+){3,12}$/, '密码是3到12位的哦'],
            nickname: function(value){
                if(value.length < 3){
                    return '昵称至少是得3个字符的哦';
                }
            }
        });

        //监听提交
        form.on('submit(loginform)', function (data) {
            /*layer.alert(JSON.stringify(data.field), {
                title : '最终的提交信息'
            })*/
            //return false;
        });

        //监听提交
        form.on('submit(adminform)', function (data) {
            /*layer.alert(JSON.stringify(data.field), {
                title : '最终的提交信息'
            })*/
            //return false;
        });

    });
</script>
<script>
    layui.use(['form'], function () {
        var form = layui.form,
            layer = layui.layer;

        //自定义验证规则
        form.verify({
            studentid: function (value) {
                if (value.length < 5) {
                    return '学号至少得5个字符啊';
                }
            },
            name: function (value) {
                if (value.length < 1) {
                    return '姓名至少得1个字符啊';
                }
            }
        });

        //监听提交
        form.on('submit(reform)', function (data) {
            /*layer.alert(JSON.stringify(data.field), {
                title : '最终的提交信息'
            })*/
            //return false;
        });

    });
</script>
<script>
    var form;
    layui.use(['layedit', 'form'], function () {
        form = layui.form;
    });
    //加载layui中的jq
    layui.use(['jquery', 'layer'], function () {
        var $ = layui.$, //重点处
            layer = layui.layer;

        $(function () {
            $.post(
                "userUpdate.html",
                {},
                function (data) {
                    var obj = JSON.parse(data);
                    var str = "";
                    for (var i = 0; i < obj.length; i++) {
                        var optionStr = "";
                        optionStr += "<option value='" + obj[i].schoolid + "'>" + obj[i].name + "</option>";
                        $("#schoolid").append(optionStr);
                        $("#schoolid").val(1);
                        form.render('select', 'formFilter');
                    }
                }
            );
        });

    });
</script>
<script>
    layui.use(function(){
        var dropdown = layui.dropdown;
        // 绑定输入框
        dropdown.render({
            elem: '#ID-dropdown-school-base-input',
            closeOnClick: false, // 不开启“打开与关闭的自动切换”，即点击输入框时始终为打开状态
            data: [{
                title: '中南大学',
                id: 101
            },{
                title: '湖南大学',
                id: 102
            },{
                title: '长沙大学',
                id: 103
            }],
            click: function(obj){
                this.elem.val(obj.title);
            },
            style: 'min-width: 235px;'
        })
    });
</script>
<script>
    layui.use(function(){
        var dropdown = layui.dropdown;
        // 绑定输入框
        dropdown.render({
            elem: '#ID-dropdown-professional-base-input',
            closeOnClick: false, // 不开启“打开与关闭的自动切换”，即点击输入框时始终为打开状态
            data: [{
                title: '计算机科学与技术',
                id: 101
            },{
                title: '软件工程',
                id: 102
            },{
                title: '大数据',
                id: 103
            },{
                title: '人工智能',
                id: 103
            }],
            click: function(obj){
                this.elem.val(obj.title);
            },
            style: 'min-width: 235px;'
        })
    });
</script>
</html>
